//https://www.bilibili.com/video/BV1d54y1f7B3/?spm_id_from=333.337.search-card.all.click&vd_source=d6fe65f095f01f05591e89d810720ccc
// 2024-10-18


import java.util.Scanner;

public class P001_统计素数个数_暴力法 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        System.out.println(bf(n));
    }

    // 给个参数n，统计n以内包括n素数有多少个
    private static int bf(int n) {
        int count = 0;
        for (int i = 2;i <= n;i++)
            if (isPrime(i)) count++;
        return count;
    }

    // 判断是否为素数
    private static boolean isPrime(int x) {
        for (int i = 2; i * i <= x; i++) // 优化：小于等于根号x即可
            if (x % i == 0) return false;
        return true;
    }
}
